const proxy = require('http-proxy-middleware')
module.exports = function (app) {
  app.use(proxy('/api1', { //遇到api1前缀的就会触发代理
    target: 'http://localhost:5000',
    changeOrigin: true, //控制服务器收到响应头Host字段的值=> res.Host for express
    pathRewrite: { '^/api1': '' }
  }))
}